import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);
import Article from "@/views/Article.vue";
import Collect from "@/views/Article.vue";
import Like from "@/views/Like.vue";
import User from "@/views/User.vue";
import Layout from "@/views/Layout.vue";
import Detail from "@/views/Detail.vue";
import Login from "@/views/Login.vue";
import Zhuce from "@/views/Zhuce.vue";
const router = new VueRouter({
  linkActiveClass: "active",
  linkExactActiveClass: "ex-active",
  routes: [
    {
      path: "/",
      redirect: "/login",
    },
    {
      path: "/login",
      component: Login,
    },
    {
      path: "/zhuce",
      component: Zhuce,
    },
    // {
    //   path: "/article",
    //   component: Article,
    // },
    // {
    //   path: "/collect",
    //   component: Collect,
    // },
    // {
    //   path: "/like",
    //   component: Like,
    // },
    // {
    //   path: "/user",
    //   component: User,
    // },

    // 一级路由   外层切换
    {
      path: "/layout",
      component: Layout,
      children: [
        // {
        //   path: "/layout",
        //   redirect: "Article",
        // },
        {
          path: "/layout/article",
          component: Article,
        },
        {
          path: "/layout/collect",
          component: Collect,
        },
        {
          path: "/layout/like",
          component: Like,
        },
        {
          path: "/layout/user",
          component: User,
        },
      ],
    },
    {
      path: "/detail",
      component: Detail,
    },
  ],
});

export default router;
// 下载  导入  安装  创建路由对象  挂载到vue实例上      配置路由表 配置出口
